Skip to content

prune/delete fixes#9422

Merged
ThomasWaldmann merged 2 commits intoborgbackup:masterfrom
ThomasWaldmann:deletion-fixes
Mar 1, 2026
Merged

prune/delete fixes#9422
ThomasWaldmann merged 2 commits intoborgbackup:masterfrom
ThomasWaldmann:deletion-fixes

Conversation

@ThomasWaldmann
Copy link
Member

Description

Format archive-related log output early, before the archive is deleted from the repo.

Checklist

  • PR is against master (or maintenance branch if only applicable there)
  • New code has tests and docs where appropriate
  • Tests pass (run tox or the relevant test subset)
  • Commit messages are clean and reference related issues



format_item() can trigger lazy loading of archive metadata (e.g. hostname,
username, size) from the repository. Previously it was called after
archive.delete(), which caused Archive.DoesNotExist for pruned archives.

Fix: call formatter.format_item() early, before any deletion takes place.

Also added a test.
…ckup#9416

here it was not a problem currently, because format_archive(archive_info) does not load the archive from the repo, but only uses the given archive_info contents.
@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.52%. Comparing base (2357071) to head (8a4f42d).
⚠️ Report is 11 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/borg/archiver/delete_cmd.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9422      +/-   ##
==========================================
+ Coverage   76.50%   76.52%   +0.01%     
==========================================
  Files          85       85              
  Lines       14818    14820       +2     
  Branches     2214     2214              
==========================================
+ Hits        11337    11341       +4     
+ Misses       2803     2802       -1     
+ Partials      678      677       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann ThomasWaldmann merged commit b38107c into borgbackup:master Mar 1, 2026
19 checks passed
@ThomasWaldmann ThomasWaldmann deleted the deletion-fixes branch March 1, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant